<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在浏览器中使用art-template</title>
</head>
<body>
    <!--引入文件
    模板引擎不关心字符串内容，只关心自己能识别的标记语言{{}}-->
    <script src='./node_modules/art-template/lib/template-web.js'></script>
    <script type=text/html id= 'tpl'>
        大家好，我叫 {{ name }}
        我今年 {{ age }} 岁了
        我来自 {{ province }}
        我喜欢 {{ each hobbies value i}} {{value}} {{ /each }}
        <!-- 我喜欢 {{ each hobbies }}  {{$value}} {{ /each }} -->
    </script>

    <script>
        var ret = template('tpl', {
            name: 'jack',
            age: 18,
            province: '北京',
            hobbies: [
                '唱歌',
                '跳舞',
                '踢球'
            ]
        })
        console.log(ret)
    </script>
</body>
</html>